/*
 * Copyright (C) 2012 SeekDeepWithin.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package com.seekdeepwithin.Controls;

import com.seekdeepwithin.Data.ITab;
import com.seekdeepwithin.MainController;
import java.io.IOException;
import javafx.beans.property.*;
import javafx.event.*;
import javafx.fxml.*;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;

/**
 * User: Jonathan Montiverdi Date: 9/28/12
 *
 * Start control for seek deep within.
 */
public class StartControl extends VBox implements ITab
{
   private StringProperty tabTitle = new SimpleStringProperty ();
   private ObjectProperty<Tooltip> tabToolTip = new SimpleObjectProperty<> ();

   /**
    * Initializes a new start control.
    */
   @SuppressWarnings ("LeakingThisInConstructor")
   public StartControl ()
   {
      this.tabTitle.set ("Start");
      FXMLLoader fxmlLoader = new FXMLLoader (getClass ().getResource ("Start.fxml"));
      fxmlLoader.setRoot (this);
      fxmlLoader.setController (this);
      try {
         fxmlLoader.load ();
      } catch (IOException ex) {
         throw new RuntimeException (ex);
      }
   }

   /**
    * Shows the study area.
    * @param event Event data.
    */
   @FXML
   private void onShowStudy (ActionEvent event)
   {
   }

   /**
    * Shows the online library.
    * @param event Event data.
    */
   @FXML
   private void onShowLibrary (ActionEvent event)
   {
      MainController.getInstance ().addTab (new LibraryControl ());
   }

   /**
    * Shows the glossary section.
    * @param event Event data.
    */
   @FXML
   private void onShowGlossary (ActionEvent event)
   {
   }

   /**
    * Shows the search.
    * @param event Event data.
    */
   @FXML
   private void onShowSearch (ActionEvent event)
   {
   }

    /**
     * Gets the title of the tab.
     * @return The title of the tab.
     */
   @Override
   public String getTabTitle ()
   {
      return this.tabTitle.get ();
   }

    /**
     * Gets the title of the tab property.
     * @return Tab title property.
     */
   @Override
   public StringProperty tabTitleProperty ()
   {
      return this.tabTitle;
   }

   /**
    * Gets the tool tip of the tab.
    * @return The tool tip of the tab.
    */
   @Override
   public Tooltip getTabToolTip ()
   {
      return this.tabToolTip.get ();
   }

   /**
    * Gets the tool tip of the tab property.
    * @return Tab tool tip property.
    */
   @Override
   public ObjectProperty<Tooltip> tabToolTipProperty ()
   {
      return this.tabToolTip;
   }

   /**
    * Occurs when the tab is closing.
    */
   @Override
   public void closing ()
   {
   }
}
